[][src]Crate kurbo

A garden of data structures for manipulating 2D shapes and curves.

The kurbo library contains data structures and algorithms for curves and vector paths. It is probably most appropriate for creative tools, but is general enough it might be useful for other applications.

Modules

common

Common mathematical operations

Structs

Affine

A 2D affine transform.

Arc

A single arc segment.

BezPath

A path that can Bézier segments up to cubic, possibly with multiple subpaths.

Circle

A circle.

CircleSegment

A segment of a circle.

ConstPoint

A trivial "curve" that is just a constant.

CubicBez

A single cubic Bézier segment.

Ellipse

An ellipse.

Insets

Insets from the edges of a rectangle.

Line

A single line.

LineIntersection

An intersection of a Line and a PathSeg.

Point

A 2D point.

QuadBez

A single quadratic Bézier segment.

Rect

A rectangle.

RoundedRect

A rectangle with equally rounded corners.

Size

A 2D size.

SvgArc

A single SVG arc segment.

TranslateScale

A transformation including scaling and translation.

Vec2

A 2D vector.

Enums

PathEl

The element of a Bézier path.

PathSeg

A segment of a Bézier path.

SvgParseError

An error which can be returned when parsing an SVG.

Constants

DEFAULT_ACCURACY

A default value for methods that take an 'accuracy' argument.

MAX_EXTREMA

The maximum number of extrema that can be reported in the ParamCurveExtrema trait.

Traits

ParamCurve

A curve parametrized by a scalar.

ParamCurveArclen

A parametrized curve that can have its arc length measured.

ParamCurveArea

A parametrized curve that can have its signed area measured.

ParamCurveCurvature

A parametrized curve that reports its curvature.

ParamCurveDeriv

A differentiable parametrized curve.

ParamCurveExtrema

A parametrized curve that reports its extrema.

ParamCurveNearest

A parametrized curve that reports the nearest point.

Shape

A generic trait for open and closed shapes.

Functions

flatten

Flatten the path, invoking the callback repeatedly.